package com.technology.io;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class InputUsing {

	public static void main(String[] args) {
		InputStream is = System.in;
		InputStreamReader isr = new InputStreamReader(is);
		BufferedReader reader = new BufferedReader(isr);
		
		PrintWriter writer = new PrintWriter(System.out);
		
		String line = null;
//		char[] buffer = new char[1024];
		do {
			try {
				line = reader.readLine();
//				reader.read(buffer);
//				line = new String(buffer);
				writer.println(line);				
				writer.flush();
			} catch (IOException e) {
				e.printStackTrace();
			}
		} while(!"quit".equalsIgnoreCase(line) && !"q".equalsIgnoreCase(line));
		
		try {
			reader.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
		writer.close();
	}

}
